/**
  ******************************************************************************
  * @file    Project/Bsp/Input.c 
  * @author  Zlf
  * @version V1.0.0
  * @date    2019-05-21
  * @brief   Input.c module
  */

/* Includes ------------------------------------------------------------------*/

	#include "INPUT.h"
	
/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/
static void Input_Init( void );
static void Output_Init( void );

/* Private variables ---------------------------------------------------------*/
F_INPUT_Typedef fInput = {
	.input_init = Input_Init,
	.output_init = Output_Init
};
	
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  This function to initialise INPUT gpio.
  * @param  None
  * @retval None
  */
static void Input_Init( void )
{
	GPIO_InitTypeDef GPIO_InitStructure;

	GPIO_InitStructure.GPIO_Pin = INPUT_PIN_0 | INPUT_PIN_1 | INPUT_PIN_2 | INPUT_PIN_3;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
	GPIO_Init( INPUT_GPIO, &GPIO_InitStructure );
	
}

static void Output_Init( void )
{
	GPIO_InitTypeDef GPIO_InitStructure;

	//configure OUT 
	GPIO_InitStructure.GPIO_Pin   = OUTPUT_PIN_0 | OUTPUT_PIN_1 | OUTPUT_PIN_2 | OUTPUT_PIN_3 ;
	GPIO_InitStructure.GPIO_Mode  =  GPIO_Mode_Out_PP;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;	
	GPIO_Init( OUTPUT_GPIO, &GPIO_InitStructure );
	
	OUT0_BIT(1);
	OUT1_BIT(1);
	OUT2_BIT(1);
	OUT3_BIT(1);
}

